package com.yuandian.ops.workbench.controller;

import com.yuandian.bpm.common.core.util.R;
import com.yuandian.ops.workbench.po.AlarmDetailParams;
import com.yuandian.ops.workbench.service.IAlarmDetailAnalysisService;
import com.yuandian.ops.workbench.vo.AlarmDetailOverviewVo;
import com.yuandian.ops.workbench.vo.AlarmDetailVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.ParseException;

/**
 * BPM 4.0
 * 运维工作台 - 告警详情分析
 *
 * @author linshihe
 * @date 2021/12/17
 */
@RestController
@RequestMapping("/ops/alarmDetail")
@Api(tags = "告警详情分析-Controller")
public class AlarmDetailAnalysisController {

    @Autowired
    private IAlarmDetailAnalysisService alarmDetailAnalysisService;

    /**
     * BPM 4.0
     * 运维工作台-告警详情分析-顶部折线图数据
     * @param params 请求参数
      * @return 结果集
     */
	@ApiOperation(value = "告警详情分析-顶部折线图数据", notes = "告警详情分析-顶部折线图数据")
	@ApiImplicitParams({
			@ApiImplicitParam(name = "groupId", 				value = "事件id", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "dataType", 				value = "数据类型", 			paramType = "query", required = true,  dataType = "Integer"),

			@ApiImplicitParam(name = "systemId", 				value = "系统id",  			paramType = "query", required = true,  dataType = "Integer"),
			@ApiImplicitParam(name = "businessCode", 			value = "业务编码", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "stepCode", 				value = "步骤编码", 			paramType = "query", required = true,  dataType = "String"),

			@ApiImplicitParam(name = "alarmIndicatorCode",  	value = "观察指标类型",		paramType = "query", required = true,  dataType = "String"),

			@ApiImplicitParam(name = "startTime", 				value = "开始时间", 			paramType = "query", required = true,   dataType = "String"),
			@ApiImplicitParam(name = "endTime", 				value = "结束时间", 			paramType = "query", required = true,   dataType = "String")
	})
    @PostMapping("/getAlarmDetailTrend")
    public R<Object> getAlarmDetailTrend(@RequestBody AlarmDetailParams params) {
        AlarmDetailVo result = alarmDetailAnalysisService.getAlarmDetailTrend(params);
        return R.ok(result);
    }

    /**
     * BPM 4.0
     * 运维工作台-告警详情分析-告警总览
     * @param params 请求参数
      * @return 结果集
     */
	@ApiOperation(value = "告警详情分析-告警总览", notes = "告警详情分析-告警总览")
	@ApiImplicitParams({
			@ApiImplicitParam(name = "groupId", 				value = "事件id", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "dataType", 				value = "数据类型", 			paramType = "query", required = true,  dataType = "Integer"),

			@ApiImplicitParam(name = "systemId", 				value = "系统id",  			paramType = "query", required = true,  dataType = "Integer"),
			@ApiImplicitParam(name = "businessCode", 			value = "业务编码", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "stepCode", 				value = "步骤编码", 			paramType = "query", required = true,  dataType = "String"),

			@ApiImplicitParam(name = "alarmIndicatorCode",  	value = "观察指标类型",		paramType = "query", required = true,  dataType = "String"),

			@ApiImplicitParam(name = "startTime", 				value = "开始时间", 			paramType = "query", required = true,   dataType = "String"),
			@ApiImplicitParam(name = "endTime", 				value = "结束时间", 			paramType = "query", required = true,   dataType = "String")
	})
    @PostMapping("/getAlarmDetailOverview")
    public R<Object> getAlarmDetailOverview(@RequestBody AlarmDetailParams params) {
        AlarmDetailOverviewVo result = alarmDetailAnalysisService.getAlarmDetailOverview(params);
        return R.ok(result);
    }

    /**
     * BPM 4.0
     * 运维工作台-告警详情分析-告警详情步骤分析
     * @param params 请求参数
      * @return 结果集
     */
	@ApiOperation(value = "告警详情分析-告警详情步骤分析", notes = "告警详情分析-告警详情步骤分析")
	@ApiImplicitParams({
			@ApiImplicitParam(name = "groupId", 				value = "事件id", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "dataType", 				value = "数据类型", 			paramType = "query", required = true,  dataType = "Integer"),

			@ApiImplicitParam(name = "systemId", 				value = "系统id",  			paramType = "query", required = true,  dataType = "Integer"),
			@ApiImplicitParam(name = "systemName", 				value = "系统名称",  		paramType = "query", required = true,  dataType = "Integer"),
			@ApiImplicitParam(name = "businessCode", 			value = "业务编码", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "businessName", 			value = "业务名称", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "stepCode", 				value = "步骤编码", 			paramType = "query", required = true,  dataType = "String"),

			@ApiImplicitParam(name = "alarmIndicatorCode",  	value = "观察指标类型",		paramType = "query", required = true,  dataType = "String"),

			@ApiImplicitParam(name = "pageNum",				 	value = "页码",    			paramType = "query", required = true,   dataType = "Long"),
			@ApiImplicitParam(name = "pageSize", 				value = "每页大小", 			paramType = "query", required = true,   dataType = "Long"),

			@ApiImplicitParam(name = "startTime", 				value = "开始时间", 			paramType = "query", required = true,   dataType = "String"),
			@ApiImplicitParam(name = "endTime", 				value = "结束时间", 			paramType = "query", required = true,   dataType = "String")
	})
    @PostMapping("/getStepAnalysis")
    public R<Object> getStepAnalysis(@RequestBody AlarmDetailParams params) {
        return R.ok(alarmDetailAnalysisService.getStepAnalysis(params));
    }

    /**
     * BPM 4.0
     * 运维工作台-告警详情分析-告警详情步骤分析Excel
     * @param params 请求参数
     */
	@ApiOperation(value = "告警详情分析-告警详情步骤分析Excel", notes = "告警详情分析-告警详情步骤分析Excel")
	@ApiImplicitParams({
			@ApiImplicitParam(name = "groupId", 				value = "事件id", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "dataType", 				value = "数据类型", 			paramType = "query", required = true,  dataType = "Integer"),

			@ApiImplicitParam(name = "systemId", 				value = "系统id",  			paramType = "query", required = true,  dataType = "Integer"),
			@ApiImplicitParam(name = "systemName", 				value = "系统名称",  		paramType = "query", required = true,  dataType = "Integer"),
			@ApiImplicitParam(name = "businessCode", 			value = "业务编码", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "businessName", 			value = "业务名称", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "stepCode", 				value = "步骤编码", 			paramType = "query", required = true,  dataType = "String"),

			@ApiImplicitParam(name = "alarmIndicatorCode",  	value = "观察指标类型",		paramType = "query", required = true,  dataType = "String"),

			@ApiImplicitParam(name = "startTime", 				value = "开始时间", 			paramType = "query", required = true,   dataType = "String"),
			@ApiImplicitParam(name = "endTime", 				value = "结束时间", 			paramType = "query", required = true,   dataType = "String")
	})
    @PostMapping("getStepAnalysisExcel")
    public void getStepAnalysisExcel(@RequestBody AlarmDetailParams params, HttpServletResponse response) {
		if (params.getDataType() != null && (params.getDataType() == 3 || params.getDataType() == 4)) {
			// 共用步骤和共用接口下载
			alarmDetailAnalysisService.getPublicStepAnalysisExcel(params, response);

		} else {
			alarmDetailAnalysisService.getStepAnalysisExcel(params, response);
		}
    }

    /**
     * BPM 4.0
     * 运维工作台-告警详情分析-告警详情步骤分析-下钻告警详情列表
     * @param params 请求参数
      * @return 结果集
     */
	@ApiOperation(value = "告警详情分析-告警详情步骤分析/告警分类统计-下钻告警详情列表", notes = "告警详情分析-告警详情步骤分析/告警分类统计-下钻告警详情列表")
	@ApiImplicitParams({
			@ApiImplicitParam(name = "groupId", 				value = "事件id", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "dataType", 				value = "数据类型", 			paramType = "query", required = true,  dataType = "Integer"),

			@ApiImplicitParam(name = "systemId", 				value = "系统id",  			paramType = "query", required = true,  dataType = "Integer"),
			@ApiImplicitParam(name = "systemName", 				value = "系统名称",  		paramType = "query", required = true,  dataType = "Integer"),
			@ApiImplicitParam(name = "businessCode", 			value = "业务编码", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "businessName", 			value = "业务名称", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "stepCode", 				value = "步骤编码", 			paramType = "query", required = true,  dataType = "String"),

			@ApiImplicitParam(name = "alarmIndicatorName",  	value = "观察指标名称",		paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "alarmRequestType",  		value = "告警请求量的类型",	paramType = "query", required = true,  dataType = "String"),

			@ApiImplicitParam(name = "pageNum",				 	value = "页码",    			paramType = "query", required = true,   dataType = "Long"),
			@ApiImplicitParam(name = "pageSize", 				value = "每页大小", 			paramType = "query", required = true,   dataType = "Long"),

			@ApiImplicitParam(name = "startTime", 				value = "开始时间", 			paramType = "query", required = true,   dataType = "String"),
			@ApiImplicitParam(name = "endTime", 				value = "结束时间", 			paramType = "query", required = true,   dataType = "String")
	})
    @PostMapping("/getStepAnalysisAlarmDetail")
    public R<Object> getStepAnalysisAlarmDetail(@RequestBody AlarmDetailParams params) {
        return R.ok(alarmDetailAnalysisService.getStepAnalysisAlarmDetail(params));
    }

    /**
     * BPM 4.0
     * 运维工作台-告警详情分析-告警详情步骤分析-下钻告警详情列表-下载
     * @param params 请求参数
	 */
	@ApiOperation(value = "告警详情分析-告警详情步骤分析/告警分类统计-下钻告警详情列表-下载", notes = "告警详情分析-告警详情步骤分析/告警分类统计-下钻告警详情列表-下载")
	@ApiImplicitParams({
			@ApiImplicitParam(name = "groupId", 				value = "事件id", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "dataType", 				value = "数据类型", 			paramType = "query", required = true,  dataType = "Integer"),

			@ApiImplicitParam(name = "systemId", 				value = "系统id",  			paramType = "query", required = true,  dataType = "Integer"),
			@ApiImplicitParam(name = "systemName", 				value = "系统名称",  		paramType = "query", required = true,  dataType = "Integer"),
			@ApiImplicitParam(name = "businessCode", 			value = "业务编码", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "businessName", 			value = "业务名称", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "stepCode", 				value = "步骤编码", 			paramType = "query", required = true,  dataType = "String"),

			@ApiImplicitParam(name = "alarmIndicatorName",  	value = "观察指标名称",		paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "alarmRequestType",  		value = "告警请求量的类型",	paramType = "query", required = true,  dataType = "String"),

			@ApiImplicitParam(name = "startTime", 				value = "开始时间", 			paramType = "query", required = true,   dataType = "String"),
			@ApiImplicitParam(name = "endTime", 				value = "结束时间", 			paramType = "query", required = true,   dataType = "String")
	})
    @PostMapping("/getStepAnalysisAlarmDetailExcel")
    public void getStepAnalysisAlarmDetailExcel(@RequestBody AlarmDetailParams params, HttpServletResponse response) throws ParseException, IOException {
        alarmDetailAnalysisService.getStepAnalysisAlarmDetailExcel(params, response);
    }

    /**
     * BPM 4.0
     * 运维工作台-告警详情分析-告警分类统计
     * @param params 请求参数
      * @return 结果集
     */
	@ApiOperation(value = "告警详情分析-告警分类统计", notes = "告警详情分析-告警分类统计")
	@ApiImplicitParams({
			@ApiImplicitParam(name = "groupId", 				value = "事件id", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "dataType", 				value = "数据类型", 			paramType = "query", required = true,  dataType = "Integer"),

			@ApiImplicitParam(name = "systemId", 				value = "系统id",  			paramType = "query", required = true,  dataType = "Integer"),
			@ApiImplicitParam(name = "systemName", 				value = "系统名称",  		paramType = "query", required = true,  dataType = "Integer"),
			@ApiImplicitParam(name = "businessCode", 			value = "业务编码", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "businessName", 			value = "业务名称", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "stepCode", 				value = "步骤编码", 			paramType = "query", required = true,  dataType = "String"),

			@ApiImplicitParam(name = "alarmIndicatorCode",  	value = "观察指标编码",		paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "alarmIndicatorIdList",  	value = "告警指标列表",		paramType = "query", required = true,  dataType = "List<Integer>"),

			@ApiImplicitParam(name = "pageNum",				 	value = "页码",    			paramType = "query", required = true,   dataType = "Long"),
			@ApiImplicitParam(name = "pageSize", 				value = "每页大小", 			paramType = "query", required = true,   dataType = "Long"),

			@ApiImplicitParam(name = "startTime", 				value = "开始时间", 			paramType = "query", required = true,   dataType = "String"),
			@ApiImplicitParam(name = "endTime", 				value = "结束时间", 			paramType = "query", required = true,   dataType = "String")
	})
    @PostMapping("/getAlarmClassificationStatistics")
    public R<Object> getAlarmClassificationStatistics(@RequestBody AlarmDetailParams params) {
        return R.ok(alarmDetailAnalysisService.getAlarmClassificationStatistics(params));
    }

    /**
     * BPM 4.0
     * 运维工作台-告警详情分析-告警分类统计-下载
     * @param params 请求参数
	 */
	@ApiOperation(value = "告警详情分析-告警分类统计-下载", notes = "告警详情分析-告警分类统计-下载")
	@ApiImplicitParams({
			@ApiImplicitParam(name = "groupId", 				value = "事件id", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "dataType", 				value = "数据类型", 			paramType = "query", required = true,  dataType = "Integer"),

			@ApiImplicitParam(name = "systemId", 				value = "系统id",  			paramType = "query", required = true,  dataType = "Integer"),
			@ApiImplicitParam(name = "systemName", 				value = "系统名称",  		paramType = "query", required = true,  dataType = "Integer"),
			@ApiImplicitParam(name = "businessCode", 			value = "业务编码", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "businessName", 			value = "业务名称", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "stepCode", 				value = "步骤编码", 			paramType = "query", required = true,  dataType = "String"),

			@ApiImplicitParam(name = "alarmIndicatorCode",  	value = "观察指标编码",		paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "alarmIndicatorIdList",  	value = "告警指标列表",		paramType = "query", required = true,  dataType = "List<Integer>"),

			@ApiImplicitParam(name = "startTime", 				value = "开始时间", 			paramType = "query", required = true,   dataType = "String"),
			@ApiImplicitParam(name = "endTime", 				value = "结束时间", 			paramType = "query", required = true,   dataType = "String")
	})
    @PostMapping("/getAlarmClassificationStatisticsExcel")
    public void getAlarmClassificationStatisticsExcel(@RequestBody AlarmDetailParams params, HttpServletResponse response) {
        alarmDetailAnalysisService.getAlarmClassificationStatisticsExcel(params, response);
    }

    /**
     * BPM 4.0
     * 运维工作台-告警详情分析-影响用户统计
     * @param params 请求参数
      * @return 结果集
     */
	@ApiOperation(value = "告警详情分析-影响用户统计", notes = "告警详情分析-影响用户统计")
	@ApiImplicitParams({
			@ApiImplicitParam(name = "groupId", 				value = "事件id", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "dataType", 				value = "数据类型", 			paramType = "query", required = true,  dataType = "Integer"),

			@ApiImplicitParam(name = "systemId", 				value = "系统id",  			paramType = "query", required = true,  dataType = "Integer"),
			@ApiImplicitParam(name = "systemName", 				value = "系统名称",  		paramType = "query", required = true,  dataType = "Integer"),
			@ApiImplicitParam(name = "businessCode", 			value = "业务编码", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "businessName", 			value = "业务名称", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "stepCodes", 				value = "步骤编码列表", 		paramType = "query", required = true,  dataType = "List<String>"),

			@ApiImplicitParam(name = "pageNum",				 	value = "页码",    			paramType = "query", required = true,   dataType = "Long"),
			@ApiImplicitParam(name = "pageSize", 				value = "每页大小", 			paramType = "query", required = true,   dataType = "Long"),

			@ApiImplicitParam(name = "startTime", 				value = "开始时间", 			paramType = "query", required = true,   dataType = "String"),
			@ApiImplicitParam(name = "endTime", 				value = "结束时间", 			paramType = "query", required = true,   dataType = "String")
	})
	@PostMapping("/getAffectUser")
    public R<Object> getAffectUser(@RequestBody AlarmDetailParams params) {
        return R.ok(alarmDetailAnalysisService.getAffectUser(params));
    }

    /**
     * BPM 4.0
     * 运维工作台-告警详情分析-影响用户统计-下载
     * @param params 请求参数
	 */
	@ApiOperation(value = "告警详情分析-影响用户统计-下载", notes = "告警详情分析-影响用户统计-下载")
	@ApiImplicitParams({
			@ApiImplicitParam(name = "groupId", 				value = "事件id", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "dataType", 				value = "数据类型", 			paramType = "query", required = true,  dataType = "Integer"),

			@ApiImplicitParam(name = "systemId", 				value = "系统id",  			paramType = "query", required = true,  dataType = "Integer"),
			@ApiImplicitParam(name = "systemName", 				value = "系统名称",  		paramType = "query", required = true,  dataType = "Integer"),
			@ApiImplicitParam(name = "businessCode", 			value = "业务编码", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "businessName", 			value = "业务名称", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "stepCodes", 				value = "步骤编码列表", 		paramType = "query", required = true,  dataType = "List<String>"),

			@ApiImplicitParam(name = "startTime", 				value = "开始时间", 			paramType = "query", required = true,   dataType = "String"),
			@ApiImplicitParam(name = "endTime", 				value = "结束时间", 			paramType = "query", required = true,   dataType = "String")
	})
	@PostMapping("/getAffectUserExcel")
    public void getAffectUserExcel(@RequestBody AlarmDetailParams params, HttpServletResponse response) {
        alarmDetailAnalysisService.getAffectUserExcel(params, response);
    }

    /**
     * BPM 4.0
     * 运维工作台-告警详情分析-影响系统统计
     * @param params 请求参数
      * @return 结果集
     */
	@ApiOperation(value = "告警详情分析-影响系统统计", notes = "告警详情分析-影响系统统计")
	@ApiImplicitParams({
			@ApiImplicitParam(name = "groupId", 				value = "事件id", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "dataType", 				value = "数据类型", 			paramType = "query", required = true,  dataType = "Integer"),

			@ApiImplicitParam(name = "systemId", 				value = "系统id",  			paramType = "query", required = true,  dataType = "Integer"),
			@ApiImplicitParam(name = "systemName", 				value = "系统名称",  		paramType = "query", required = true,  dataType = "Integer"),
			@ApiImplicitParam(name = "businessCode", 			value = "业务编码", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "businessName", 			value = "业务名称", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "stepCodes", 				value = "步骤编码列表", 		paramType = "query", required = true,  dataType = "List<String>"),

			@ApiImplicitParam(name = "pageNum",				 	value = "页码",    			paramType = "query", required = true,   dataType = "Long"),
			@ApiImplicitParam(name = "pageSize", 				value = "每页大小", 			paramType = "query", required = true,   dataType = "Long"),

			@ApiImplicitParam(name = "startTime", 				value = "开始时间", 			paramType = "query", required = true,   dataType = "String"),
			@ApiImplicitParam(name = "endTime", 				value = "结束时间", 			paramType = "query", required = true,   dataType = "String")
	})
	@PostMapping("/getAffectSystem")
    public R<Object> getAffectSystem(@RequestBody AlarmDetailParams params) {
        return R.ok(alarmDetailAnalysisService.getAffectSystem(params));
    }

    /**
     * BPM 4.0
     * 运维工作台-告警详情分析-影响系统统计-下载
     * @param params 请求参数
	 */
	@ApiOperation(value = "告警详情分析-影响系统统计-下载", notes = "告警详情分析-影响系统统计-下载")
	@ApiImplicitParams({
			@ApiImplicitParam(name = "groupId", 				value = "事件id", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "dataType", 				value = "数据类型", 			paramType = "query", required = true,  dataType = "Integer"),

			@ApiImplicitParam(name = "systemId", 				value = "系统id",  			paramType = "query", required = true,  dataType = "Integer"),
			@ApiImplicitParam(name = "systemName", 				value = "系统名称",  		paramType = "query", required = true,  dataType = "Integer"),
			@ApiImplicitParam(name = "businessCode", 			value = "业务编码", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "businessName", 			value = "业务名称", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "stepCodes", 				value = "步骤编码列表", 		paramType = "query", required = true,  dataType = "List<String>"),

			@ApiImplicitParam(name = "startTime", 				value = "开始时间", 			paramType = "query", required = true,   dataType = "String"),
			@ApiImplicitParam(name = "endTime", 				value = "结束时间", 			paramType = "query", required = true,   dataType = "String")
	})
	@PostMapping("/getAffectSystemExcel")
    public void getAffectSystemExcel(@RequestBody AlarmDetailParams params, HttpServletResponse response) throws IOException {
        alarmDetailAnalysisService.getAffectSystemExcel(params, response);
    }

    /**
     * BPM 4.0
     * 运维工作台-告警详情分析-影响业务统计
     * @param params 请求参数
      * @return 结果集
     */
	@ApiOperation(value = "告警详情分析-影响业务统计", notes = "告警详情分析-影响业务统计")
	@ApiImplicitParams({
			@ApiImplicitParam(name = "groupId", 				value = "事件id", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "dataType", 				value = "数据类型", 			paramType = "query", required = true,  dataType = "Integer"),

			@ApiImplicitParam(name = "systemId", 				value = "系统id",  			paramType = "query", required = true,  dataType = "Integer"),
			@ApiImplicitParam(name = "systemName", 				value = "系统名称",  		paramType = "query", required = true,  dataType = "Integer"),
			@ApiImplicitParam(name = "businessCode", 			value = "业务编码", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "businessName", 			value = "业务名称", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "stepCodes", 				value = "步骤编码列表", 		paramType = "query", required = true,  dataType = "List<String>"),

			@ApiImplicitParam(name = "pageNum",				 	value = "页码",    			paramType = "query", required = true,   dataType = "Long"),
			@ApiImplicitParam(name = "pageSize", 				value = "每页大小", 			paramType = "query", required = true,   dataType = "Long"),

			@ApiImplicitParam(name = "startTime", 				value = "开始时间", 			paramType = "query", required = true,   dataType = "String"),
			@ApiImplicitParam(name = "endTime", 				value = "结束时间", 			paramType = "query", required = true,   dataType = "String")
	})
	@PostMapping("/getAffectBusiness")
    public R<Object> getAffectBusiness(@RequestBody AlarmDetailParams params) {
        return R.ok(alarmDetailAnalysisService.getAffectBusiness(params));
    }

    /**
     * BPM 4.0
     * 运维工作台-告警详情分析-影响业务统计-下载
     * @param params 请求参数
      * @return 结果集
     */
	@ApiOperation(value = "告警详情分析-影响业务统计-下载", notes = "告警详情分析-影响业务统计-下载")
	@ApiImplicitParams({
			@ApiImplicitParam(name = "groupId", 				value = "事件id", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "dataType", 				value = "数据类型", 			paramType = "query", required = true,  dataType = "Integer"),

			@ApiImplicitParam(name = "systemId", 				value = "系统id",  			paramType = "query", required = true,  dataType = "Integer"),
			@ApiImplicitParam(name = "systemName", 				value = "系统名称",  		paramType = "query", required = true,  dataType = "Integer"),
			@ApiImplicitParam(name = "businessCode", 			value = "业务编码", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "businessName", 			value = "业务名称", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "stepCodes", 				value = "步骤编码列表", 		paramType = "query", required = true,  dataType = "List<String>"),

			@ApiImplicitParam(name = "pageNum",				 	value = "页码",    			paramType = "query", required = true,   dataType = "Long"),
			@ApiImplicitParam(name = "pageSize", 				value = "每页大小", 			paramType = "query", required = true,   dataType = "Long"),

			@ApiImplicitParam(name = "startTime", 				value = "开始时间", 			paramType = "query", required = true,   dataType = "String"),
			@ApiImplicitParam(name = "endTime", 				value = "结束时间", 			paramType = "query", required = true,   dataType = "String")
	})
	@PostMapping("/getAffectBusinessExcel")
    public void getAffectBusinessExcel(@RequestBody AlarmDetailParams params, HttpServletResponse response) {
        alarmDetailAnalysisService.getAffectBusinessExcel(params, response);
    }

    /**
     * BPM 4.0
     * 运维工作台-告警详情分析-区域告警统计分析
     * @param params 请求参数
      * @return 结果集
     */
	@ApiOperation(value = "告警详情分析-区域告警统计分析", notes = "告警详情分析-区域告警统计分析")
	@ApiImplicitParams({
			@ApiImplicitParam(name = "groupId", 				value = "事件id", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "dataType", 				value = "数据类型", 			paramType = "query", required = true,  dataType = "Integer"),

			@ApiImplicitParam(name = "businessCode", 			value = "业务编码", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "businessName", 			value = "业务名称", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "stepCode", 				value = "步骤编码", 			paramType = "query", required = true,  dataType = "String"),

			@ApiImplicitParam(name = "startTime", 				value = "开始时间", 			paramType = "query", required = true,   dataType = "String"),
			@ApiImplicitParam(name = "endTime", 				value = "结束时间", 			paramType = "query", required = true,   dataType = "String")
	})
	@PostMapping("/getAreaAlarmAnalysis")
    public R<Object> getAreaAlarmAnalysis(@RequestBody AlarmDetailParams params) {
        return R.ok(alarmDetailAnalysisService.getAreaAlarmAnalysis(params));
    }

    /**
     * BPM 4.0
     * 运维工作台-告警详情分析-共用步骤接口分析
     * @param params 请求参数
      * @return 结果集
     */
	@ApiOperation(value = "告警详情分析-共用步骤接口分析", notes = "告警详情分析-共用步骤接口分析")
	@ApiImplicitParams({
			@ApiImplicitParam(name = "groupId", 				value = "事件id", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "dataType", 				value = "数据类型", 			paramType = "query", required = true,  dataType = "Integer"),

			@ApiImplicitParam(name = "systemId", 				value = "系统id",  			paramType = "query", required = true,  dataType = "Integer"),
			@ApiImplicitParam(name = "systemName", 				value = "系统名称",  		paramType = "query", required = true,  dataType = "Integer"),
			@ApiImplicitParam(name = "businessCode", 			value = "业务编码", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "businessName", 			value = "业务名称", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "stepCode", 				value = "步骤编码", 			paramType = "query", required = true,  dataType = "String"),

			@ApiImplicitParam(name = "alarmIndicatorCode",  	value = "观察指标类型",		paramType = "query", required = true,  dataType = "String"),

			@ApiImplicitParam(name = "pageNum",				 	value = "页码",    			paramType = "query", required = true,   dataType = "Long"),
			@ApiImplicitParam(name = "pageSize", 				value = "每页大小", 			paramType = "query", required = true,   dataType = "Long"),

			@ApiImplicitParam(name = "startTime", 				value = "开始时间", 			paramType = "query", required = true,   dataType = "String"),
			@ApiImplicitParam(name = "endTime", 				value = "结束时间", 			paramType = "query", required = true,   dataType = "String")
	})
	@PostMapping("/getPublicStepAnalysis")
    public R<Object> getPublicStepAnalysis(@RequestBody AlarmDetailParams params) {
        return R.ok(alarmDetailAnalysisService.getPublicStepAnalysis(params));
    }

    /**
     * BPM 4.0
     * 运维工作台-告警详情分析-共用步骤接口分析-下载
     * @param params 请求参数
	 */
	@ApiOperation(value = "告警详情分析-共用步骤接口分析-下载", notes = "告警详情分析-共用步骤接口分析-下载")
	@ApiImplicitParams({
			@ApiImplicitParam(name = "groupId", 				value = "事件id", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "dataType", 				value = "数据类型", 			paramType = "query", required = true,  dataType = "Integer"),

			@ApiImplicitParam(name = "systemId", 				value = "系统id",  			paramType = "query", required = true,  dataType = "Integer"),
			@ApiImplicitParam(name = "systemName", 				value = "系统名称",  		paramType = "query", required = true,  dataType = "Integer"),
			@ApiImplicitParam(name = "businessCode", 			value = "业务编码", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "businessName", 			value = "业务名称", 			paramType = "query", required = true,  dataType = "String"),
			@ApiImplicitParam(name = "stepCode", 				value = "步骤编码", 			paramType = "query", required = true,  dataType = "String"),

			@ApiImplicitParam(name = "alarmIndicatorCode",  	value = "观察指标类型",		paramType = "query", required = true,  dataType = "String"),

			@ApiImplicitParam(name = "startTime", 				value = "开始时间", 			paramType = "query", required = true,   dataType = "String"),
			@ApiImplicitParam(name = "endTime", 				value = "结束时间", 			paramType = "query", required = true,   dataType = "String")
	})
	@PostMapping("/getPublicStepAnalysisExcel")
    public void getPublicStepAnalysisExcel(@RequestBody AlarmDetailParams params, HttpServletResponse response) {
        alarmDetailAnalysisService.getPublicStepAnalysisExcel(params, response);
    }

}
